#!/bin/bash

# We need to unconfigure and purge module's configuration
# before the gconf schemas have been removed (i.e before gconf
# debhelper has been run). That's why we do things before
# and after gconf debhelper is run
if [ "$1" = "purge" ]; then
        # Purge configuration
        /usr/share/ebox/ebox-clean-gconf egroupware || true

        su postgres -c "dropdb egroupware; dropuser egroupware"
fi


#DEBHELPER#

case "$1" in
    remove)
        kill `pidof gconfd-2` >/dev/null 2>&1 || true

#        [ -f /etc/apache2/sites-available/egroupware ] && mv /etc/apache2/sites-available/egroupware /etc/apache2/conf.d


        dpkg-trigger --no-await ebox
    ;;
esac


